//引入SQL，database: "web1911" 是数据库名字， host: "localhost",
const mysql = require("mysql");
const MySQLObj = {
    host: "127.0.0.1",
    user: "root",
    password: "", 
    database: "web1910"
}
// 连接客户端
const client=mysql.createConnection(MySQLObj);
function SQLConnect(sql,arr,callback) {
    client.query(sql,arr,(error,result)=>{
        if (error) {
            console.log(error);
            return;
        }
        callback(result);
    })
}
// 导出
module.exports=SQLConnect;